<?php
require_once( 'common.php' );
$template->title = "Welcome to admin Group page!";
$template->welcomeMsg = "Welcome to admin Group page!";
if( isset( Url::$pageVars[ 'GETPOST' ][ 'id' ] ) ){
	if( is_numeric( Url::$pageVars[ 'GETPOST' ][ 'id' ] ) ){
		$template->group = GroupUtility::getGroup( Url::$pageVars[ 'GETPOST' ][ 'id' ] );
	}
}

$teamId = isset( Url::$pageVars[ 'GETPOST' ][ 'tid' ] ) ? Url::$pageVars[ 'GETPOST' ][ 'tid' ] : 0;
$template->teams = $teams = Utility::getAllTeams( $teamId );

$template->groups = $teamId > 0 ? GroupUtility::getGroups( $teamId ) : array();